<?php
     //证书模板的位置
        $certificate_path = 'img/50_xiao.jpg';
        $jpgName ='tmp/' . uniqid() . '.jpg';
        // $qrcodeImage = imagecreatefromjpeg($weicode);
        $qrcodeImageResized = imagecreate(160, 160);
        //imagecopyresampled($qrcodeImageResized, $qrcodeImage, 0, 0, 0, 0, 160, 160, 430, 430);
        $posterImage = imagecreatefromjpeg($certificate_path);
        imagecopy($posterImage, $qrcodeImageResized, 450, 860, 0, 0, 160, 160);
        //向图片中写入字体
        setGDFontNew($posterImage, '你还好的');
        imagejpeg($posterImage, $jpgName, 100);


    function setGDFontNew($img, $content)
    {
        //字体大小
        $size = 35;
        //字体类型，
        $font = 'font/FZY4JW.TTF';
        //设置字体颜色
        imagecolorallocate($img, 255, 255, 255);//第一次调用时对底板设置颜色
        $black = imagecolorallocate($img, 0, 0, 0);//第二次对字体设置颜色
        //将ttf文字写到图片中
        $fontBox = imagettfbbox($size, 0, $font, $content);//文字水平居中实质
//        imagettftext($img, $size, 0, 280 - $fontBox[2], 348, $black, $font, $content);
        imagettftext($img, $size, 0, 222 - $fontBox[2], 348, $black, $font, $content);
    }


        .piano_end .end_user{
        position: absolute;
        border: 1px red solid;
        width: 36%;
        height: 5.5%;
        top:30.2%;
        right:64%;
        color:black;
        font-size: 1.4rem;
        text-align: right;
    }